package norm.reference

class Tuple implements Comparable<Tuple>{

	long id
	BigDecimal value 
	BigDecimal probability
	
	static belongsTo = [cdf:CDF]
	
    static constraints = {
		value(blank:false)
		probability(blank:false)	
    }
	
	static mapping = {
		table "NORM_cdf"
	}
	
	public int compareTo(Tuple otherTuple)
	{
		if(value>otherTuple.value)
		{
			return 1
		}
		else if(value<otherTuple.value)
		{
			return -1
		}
		else
		{
			return 0
		}
	}
}
